package com.shu.util;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class ResponseUtil implements Serializable{

	private static final long serialVersionUID = 1L;
	
	private boolean result;
	private Map<String,Object> data;
	
	public ResponseUtil(){
		result = true;
		data = new HashMap<>();
	}

	public boolean isResult() {
		return result;
	}

	public void setResult(boolean result) {
		this.result = result;
	}

	public Map<String, Object> getDataMap() {
		return data;
	}

	public void setDataMap(Map<String, Object> dataMap) {
		this.data = dataMap;
	}

	public void addAttribute(String attribbuteName, Object attribbute) {
		this.getDataMap().put(attribbuteName,attribbute);
	}
	
	public void setMessage(String message) {
		this.addAttribute("message", message);
	}
	
	public void setView(String view) {
		this.addAttribute("view", view);
	}
	
}
